package com.shujia.MR.partitions;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

// 由于Partitioner中处理的数据Map中的write写出的Key Value 类型
public class MyPartition extends Partitioner<Text, Student> {

    @Override
    public int getPartition(Text text, Student student, int numPartitions) {
        if(student.gender.equals("男")){
            return 0;
        }else{
            return 1;
        }
    }
}
